﻿@{
    Layout = "~/Areas/Admin/Views/Shared/_LayoutCMS.cshtml";
    ViewBag.Title = "TrustEdit";
}
@model LY.Entity.T_Trust
<h2></h2>
<link href="~/Content/assets/css/Layout/css/main.css" rel="stylesheet" />
<link href="~/Content/assets/css/plugin/validator.css" rel="stylesheet" />
<link href="~/Content/assets/css/plugin/xjgrid.css" rel="stylesheet" />
<script src="~/Content/assets/layer/layer.min.js"></script>
<script src="~/Content/assets/js/jquery.uploadify.v2.1.4.js"></script>
<script src="~/Content/editor/kindeditor-min.js"></script>
<script src="~/Content/editor/lang/zh_CN.js"></script>

<div class="container">
    <div id="forms" class="mt10" aria-disabled="False">
        <div class="box">
            <div class="box_border">
                <div class="box_top"><b class="pl15">编辑信托信息</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;带“ <span style="color: red">*</span> ”标识为必填项</div>
                <div class="box_center">
                    <form  id="frmEdit" method="post" action="@Url.Action("TrustSave")" role="form" class="jqtransform">
                        <input id="hideId" name="ID" value="@Model.ID" type="hidden" />
                        <table class="form_table pt15 pb15" style="width: 100%;" border="0">
                            <tr>
                                <td class="td_right"><b style="color: red;">*&nbsp;</b>信托产品名称：</td>
                                <td class="">
                                    <input type="text" id="Name" name="Name" value="@Model.Name" maxlength="15" class="input-text lh30" size="40">
                                </td>
                                <td class="td_right"><b style="color: red;">*&nbsp;</b>信托公司：</td>
                                <td class="">
                                    @* @Html.ResourceDropDownList("FundID", "FUND",Model.FundID, new { @class="wh80 select"})*@
                                    <input type="text" id="TrustCompany" name="TrustCompany" value="@Model.TrustCompany" maxlength="15" class="input-text lh30" size="40">
                                </td>
                            </tr>
                            <tr>
                                <td class="td_right">简介：</td>
                                <td class="">
                                    @*@Html.ResourceDropDownList("EDUCATION", "EDUCATION", @Model.Education,new {@class="wh80 select" })*@
                                    <input type="text" id="Introduction" name="Introduction" value="@Model.Introduction" maxlength="100"  class="input-text lh30" size="40">
                                </td>
                                <td class="td_right"><b style="color: red;">*&nbsp;</b>起购金额：</td>
                                <td class="">
                                    <input type="text"  id="Minamount" name="Minamount" maxlength="13" value="@Model.Minamount" onkeyup="this.value=this.value.replace(/[^\d]/g,'')" onafterpaste="this.value=this.value.replace(/[^\d]/g,'')"  class="input-text lh30" size="40" />
                                    <span style="color: red;">万</span>
                                    @*<input type="text" id="Minamount"  onblur="getFloatStr(this.id,this.value);" name="Minamount" value="@Model.Minamount" class="input-text lh30" size="40">元*@
                                </td>
                            </tr>
                            <tr>
                                <td class="td_right">信托类型：</td>
                                <td class="">
                                    <input type="text" id="Trusttype" name="Trusttype" value="@Model.Trusttype" maxlength="15" class="input-text lh30" size="40">
                                </td>
                                <td class="td_right"><b style="color: red;">*&nbsp;</b>户名：</td>
                                <td class="">
                                    <input type="text" id="AccountName" name="AccountName"  maxlength="5" @*onkeyup="this.value=this.value.replace(/[^\u4E00-\u9FA5]/g,'')" onafterpaste="this.value=this.value.replace(/[^\u4E00-\u9FA5]/g,'')"*@  value="@Model.AccountName" class="input-text lh30" size="40">
                                </td>
                            </tr>
                            <tr>
                                <td class="td_right"><b style="color: red;">*&nbsp;</b>账号：</td>
                                <td class="">
                                    <input type="text" id="AccountNumber" name="AccountNumber" onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"   @*onblur="ValidateAccount(this.id,this.value)"*@  maxlength="20" value="@Model.AccountNumber" class="input-text lh30" size="40">
                                </td>
                                <td class="td_right">开户行：</td>
                                <td class="">
                                    <input type="text" id="Bank" name="Bank" maxlength="10" class="input-text lh30" value="@Model.Bank" size="40" />
                                </td>
                            </tr>
                            <tr>
                                <td class="td_right"><b style="color: red;">*&nbsp;</b>年化收益率：</td>
                                <td class="">
                                    <input type="text" id="Annualized" name="Annualized" value="@Model.Annualized" onblur="util.getFloatStr(this.id,this.value)" maxlength="3"  class="input-text lh30" size="10"><span style="color: red;">%@*（范围：0-100）*@</span>
                                </td>
                                <td class="td_right"><b style="color: red;">*&nbsp;</b>期限：</td>
                                <td class="">
                                    <input type="text" id="Deadline" name="Deadline" maxlength="2" class="input-text lh30" value="@Model.Deadline"  onkeyup="this.value=this.value.replace(/[^\d]/g,'')" onafterpaste="this.value=this.value.replace(/[^\d]/g,'')" size="40" /><span style="color: red;">个月</span>
                                </td>
                            </tr>
                            <tr>
                                <td class="td_right">备注：</td>
                                <td class="" colspan="3">
                                    <input type="hidden" id="hideRemark" name="Remark" value="@Model.Remark">
                                    <textarea id="Remark" rows="10" style="height: 260px; width: 90%">@Model.Remark</textarea>
                                    
                                </td>
                            </tr>
                            <tr>
                                <td class="td_center" colspan="5">
                                    <input type="button" id="btnSave" name="button" style="margin-right: 50px;" class="btn btn82 btn_save2" value="保存">
                                    <input type="button" id="btnReturn" name="button" class="btn btn82 btn_res" value="返回">
                                </td>
                            </tr>
                        </table>
                        <input type="hidden" id="hideContent" name="Peopleremark" />
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
@section jssection{
    <script type="text/javascript">
        var util = {};
        var options = {
            editUrl: "@Url.Action("FundPeopleSave")",
        };
        
        //编辑器
        KindEditor.ready(function (K) {
            window.editor = K.create('textarea', {
                resizeType: 1,
                allowPreviewEmoticons: false,
                allowImageUpload: true,
                minWidth: 350,
                allowFileManager: true,
                afterBlur: function () {
                    this.sync();
                }

            });
        });

    </script>

    <script src="~/Content/assets/plugins/validator/validator.js"></script>
    <script src="~/Content/assets/js/common.js"></script>
    <script src="~/Content/assets/DatePicker/WdatePicker.js"></script>
    <script src="~/Content/assets/layer/layer.min.js"></script>
    <script src="~/Content/assets/app/common/ajaxupload.js"></script>
    <script src="~/Content/assets/app/trust/trustedit.js"></script>
}
<script type="text/javascript">

    getFloatStr = function (id, num) {
        alert(num);
        num = num.replace(/[^0-9|\.]/g, ''); //清除字符串中的非数字非.字符
        alert(num);
        if (num > 100) {
            alert("num:" + 100);
            num = 100;
        }
        var no = changeTwoDecimal(parseFloat(num));
        if (!no) {
            $('#' + id).val('');
        }
        else {
            $('#' + id).val(no.toFixed(2));
        }
    };

    function changeTwoDecimal(x) {
        if (isNaN(x)) {
            return false;
        }

        f_x = Math.round(x * 100) / 100;
        return f_x;
    }
</script>
<script type="text/javascript">
    var u = UE.getEditor('Remark');

    function ValidateAccount(id, val) {
        if (isNaN(val)) {
            alert("账号不能为非数字！");
            $("#AccountNumber").val("");
            return false;
        }
        else if (val == "") {
            alert("账号为必填！");
            return false;
        }
        else if (!(val.length >= 16 && val.length <= 19)) {
            alert("账号格式不正确！账号为16-19位字符的数字！");
            $("#AccountNumber").focus();
            return false;
        }
    }

    function ValidateAccountName(ac) {
        if (ac == "") {
            alert("请填写账户名！");
            return false;
        }
        var patrn = /^\s*[\u4e00-\u9fa5]{1,}[\u4e00-\u9fa5.·]{0,15}[\u4e00-\u9fa5]{1,}\s*$/;
        if (!patrn.exec(ac)) {
            alert("户名为2-15字的中文");
            $("#AccountName").val("");
            $("#AccountName").focus();
            return false;
        }
        return true;
    }
    
    
</script>
